// 客户差额账单
export const CustomerThead = [
  {
    type: 'selection',
    minWidth: 60,
    align: 'center'
  },
  {
    title: '费用月份',
    key: 'feeDate',
    width: 100,
    tooltip: true,
    render: (h, params) => {
      const month = params.row.periodMonth < 10 ? '0' + params.row.periodMonth : params.row.periodMonth
      const text = params.row.periodYear + '' + month
      return h('span', text)
    }
  },
  {
    title: '客户名称',
    key: 'companyName',
    minWidth: 200,
    tooltip: true
  },
  {
    title: '所属客服',
    key: 'serverName',
    width: 250,
    align: 'center'
  },
  {
    title: '应收总计',
    key: 'shouldTotal',
    minWidth: 150,
    tooltip: true
  },
  {
    title: '应付总计',
    key: 'payTotal',
    minWidth: 150,
    tooltip: true
  },
  {
    title: '差额',
    key: 'balanceTotal',
    minWidth: 150,
    tooltip: true
  },
  {
    title: '处理状态',
    key: 'status',
    minWidth: 150,
    tooltip: true,
    render: (h, params) => {
      const text = params.row.status === 0 ? '未处理' : '已处理'
      return h('span', text)
    }
  },
  {
    title: '操作',
    key: 'action',
    slot: 'action',
    fixed: 'right',
    width: 80
  }
]

// 差额明细
export const CustomerDetailThead = [
  // {
  //   type: 'selection',
  //   minWidth: 60,
  //   align: 'center'
  // },
  {
    title: '费用月份',
    key: 'feeDate',
    width: 150,
    align: 'center',
    render: (h, params) => {
      const month = params.row.periodMonth < 10 ? '0' + params.row.periodMonth : params.row.periodMonth
      const text = params.row.periodYear + '' + month
      return h('span', text)
    }
  },
  {
    title: '客户名称',
    key: 'companyName',
    width: 250,
    align: 'center'
  },
  {
    title: '姓名',
    key: 'employeeName',
    width: 150,
    align: 'center'
  },
  {
    title: '身份证号码',
    key: 'idCardNo',
    width: 200,
    align: 'center'
  },
  {
    title: '参保编号',
    key: 'insureNo',
    width: 150,
    align: 'center'
  },
  {
    title: '险种',
    key: 'insuranceName',
    width: 150,
    align: 'center'
  },
  {
    title: '单位/个人',
    key: 'isPerson',
    width: 150,
    align: 'center',
    render: (h, params) => {
      const text = params.row.isPerson === 0 ? '单位' : '个人'
      return h('span', text)
    }
  },
  {
    title: '应收总计',
    key: 'shouldTotal',
    width: 150,
    align: 'center'
  },
  {
    title: '应付总计',
    key: 'payTotal',
    width: 150,
    align: 'center'
  },
  {
    title: '差额',
    key: 'balanceTotal',
    width: 150,
    align: 'center'
  },
  {
    title: '处理状态',
    key: 'status',
    width: 150,
    align: 'center',
    render: (h, params) => {
      const text = params.row.status === 0 ? '未处理' : '已处理'
      return h('span', text)
    }
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    slot: 'action',
    width: 120,
    align: 'center'
  }
]

// 差额处理弹窗
export const BalanceProcessModalThead = [
  {
    title: '处理方式',
    key: 'handleType',
    width: 150,
    tooltip: true,
    render: (h, params) => {
      var arr = [
        { key: 1, value: '退款' },
        { key: 2, value: '垫付（补收）' },
        { key: 3, value: '营业外收入' },
        { key: 4, value: '挂账（待处理）' },
        { key: 5, value: '无需处理' }
      ]
      var text = ''
      arr.map(item => {
        if (item.key == params.row.handleType) {
          text = item.value
        }
      })
      return h('span', text)
    }
  },
  {
    title: '处理差额',
    key: 'total',
    tooltip: true
  },
  {
    title: '差额说明',
    key: 'remark',
    width: 250,
    tooltip: true
  },
  {
    title: '操作',
    key: 'action',
    slot: 'action',
    width: 100
  }
]

// 应付差额说明
export const payableBalanceThead = [
  // {
  //   type: 'selection',
  //   minWidth: 60,
  //   align: 'center'
  // },
  {
    title: '费用月份',
    key: 'feeDate',
    width: 150,
    align: 'center',
    render: (h, params) => {
      const month = params.row.month < 10 ? '0' + params.row.month : params.row.month
      const text = params.row.year + '' + month
      return h('span', text)
    }
  },
  {
    title: '客户名称',
    key: 'companyName',
    width: 250,
    align: 'center'
  },
  {
    title: '所属客服',
    key: 'serverName',
    width: 250,
    align: 'center'
  },
  {
    title: '姓名',
    key: 'empName',
    width: 150,
    align: 'center'
  },
  {
    title: '身份证号码',
    key: 'idCardNo',
    width: 200,
    align: 'center'
  },
  {
    title: '状态',
    key: 'beHiring',
    width: 100,
    align: 'center',
    render: (h, params) => {
      const text = params.row.beHiring ? '在职' : '离职'
      return h('span', text)
    }
  },
  {
    title: '参保编号',
    key: 'insureNo',
    width: 200,
    align: 'center'
  },
  {
    title: '险种',
    key: 'insuranceName',
    width: 150,
    align: 'center'
  },
  {
    title: '单位/个人',
    key: 'isPersonalBurden',
    width: 150,
    align: 'center',
    render: (h, params) => {
      const text = params.row.isPersonalBurden === 0 ? '单位' : '个人'
      return h('span', text)
    }
  },
  {
    title: '处理方式',
    key: 'handleType',
    width: 150,
    tooltip: true,
    render: (h, params) => {
      var arr = [
        { key: 1, value: '退款' },
        { key: 2, value: '垫付（补收）' },
        { key: 3, value: '营业外收入' },
        { key: 4, value: '挂账（待处理）' },
        { key: 5, value: '无需处理' }
      ]
      var text = ''
      arr.map(item => {
        if (item.key == params.row.handleType) {
          text = item.value
        }
      })
      return h('span', text)
    }
  },
  {
    title: '处理差额',
    key: 'amt',
    width: 150,
    tooltip: true
  },
  {
    title: '差额说明',
    key: 'remark',
    width: 250,
    tooltip: true
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    slot: 'action',
    width: 120,
    align: 'center'
  }
]
